vvar $_= function(a){if(document.getElementById) return document.getElementById(a)},M = new ANCMusic();

function ANCMusic(){
        
        m_w = this.width;
        i_1 = this.id1;
        i_2 = this.id2;
        au = this.auto;
		
		if(au == '1'){aut = 'true';}else{aut = 'flase';}
		
        this.r = function(){
			var k = $_(i_1).innerHTML;
			k = k.replace(/\[m\]/gi,"<span id='anc_ms' style='display: none;'>");
			k = k.replace(/\[\/m\]/gi,"</span>");
			k = k.replace(/\[FLASH]/gi,"<span id='anc_ms' style='display: none;'>");
			k = k.replace(/\[\/FLASH]/gi,"</span>");
			$_(i_1).innerHTML = k;
			
			return z = $_("anc_ms").innerHTML;
        }
		
   this.p = function(x){
		$_(i_2).innerHTML = M.l(x);
		//document.write(M.l("http://mp3.zing.vn/bai-hat/Gio-Lanh-Cao-Thai-Son/ZWZD7EO0.html"));
		//document.write(M.l("http://www.nhaccuatui.com/nghe?M=eYY7QIkAx4"));
		//document.write(M.l("http://nhacso.net/nghe-nhac/honey-honey.WVBZVktX.html"));
		//document.write(M.l("http://www29.zippyshare.com/v/84705837/file.html"));
		//document.write(M.l("http://hn.nhac.vui.vn/em-luon-o-trong-tam-tri-anh-the-men-m198386c3p5314.html"));
		//document.write(M.l("http://musik.soha.vn/mp3/decv89hwexo/Be-My-Baby-Wonder-Girls.html"));
		//document.write(M.l("http://s1.chacha.vn/audio/mp3/0/0/85/87785.mp3"));
    }
	
	this.l  = function(x){
	var obj = "";
	var y=new Array();
		if(x.indexOf("zing.vn") != -1){y = x.match(/[\d\w]+/gi); c = y.length - 2; obj = o(y[c])[0]; M.css("80");}
		if(x.indexOf("nhaccuatui.com") != -1){x = x.replace(/nghe\?M\=/gi,"m/"); x = x.replace(/nghe\?L\=/gi,"l/"); obj = o(x)[1]; M.css("150");}
		if(x.indexOf("zippyshare.com") != -1){y = x.match(/\d+/gi); obj = o(y)[2]; M.css("20");}
		if(x.indexOf("nhacso.net") != -1){y = x.match(/[\d\w]+/gi); c = y.length - 2; obj = o(y[c])[3]; M.css("35");}
		if(x.indexOf("nhac.vui.vn") != -1){y = x.match(/[0-9]+/gi); obj = o(y[0])[4];}
		if(x.indexOf("musik.soha.vn") != -1){y = x.match(/\bd[\w\d]+/gi); obj = o(y[0].replace(/d/gi,""))[5];}
		if(x.indexOf(".mp3") != -1 && x.indexOf("zing.vn") == -1){obj = o(x)[6]; M.css("20");}
		return obj;
	}
	
	this.css = function(x){
		css  = "<style>";
		css += ".lof-slidecontent{height:"+x+"px;}";
		css += "</style>";
		document.write(css);
	
	}
}

var o = function(x){
		_mode = 'quality="high" wmode="transparent" type="application/x-shockwave-flash" allowscriptaccess="always"';
	return data = [
		//Mp3.zing
		'<embed width="'+m_w+'" height="80" src="http://static.mp3.zing.vn/skins/gentle/flash/mp3Player.swf?xmlURL=http://mp3.zing.vn/play/?pid='+x+'||4&amp;songID=0&amp;autoplay='+aut+'" '+_mode+'/>', //mp3
		//Nhaccuatui
		'<embed width="'+m_w+'" height="150" flashvars="&amp;autostart='+au+'" src="'+x+'" '+_mode+'/>',
		//Zippyshare
		'<embed width="'+m_w+'" height="20"  src="http://www'+x[0]+'.zippyshare.com/swf/player.swf" '+_mode+' flashvars="&amp;file=http://www'+x[0]+'.zippyshare.com/downloadMusic?key='+x[1]+'&time=1&amp;volume=80&amp;autostart='+au+'&amp;type=flv&skin=http://www.longtailvideo.com/files/skins/fs40/5/fs40.zip"/>',
		//Nhacso.net
		'<embed width="'+m_w+'" height="60" autostart="true" '+_mode+' flashvars="xmlPath=http://nhacso.net/flash/song/xnl/1/id/'+x+'&amp;adsLink=&amp;colorAux=0xff4a4a&amp;colorMain=0xeffcfc&amp;colorBorder=0x078939&amp;typePlayer=single&amp;mAuto='+au+'" src="http://st.nhacso.net/flash/v61/embedPlaylistjs.swf"/>',
		//Nhac.vui.vn
		'<embed width="'+m_w+'" height="127" flashvars="playlistfile=http://hn.nhac.vui.vn/asx2.php%3Ftype%3D1%26id%3D'+x+'&amp;frontcolor=1717f7&amp;lightcolor=ff4a4a&amp;screencolor=000000&amp;bufferlength=10&amp;volume=100&amp;playlist=bottom&amp;playlistsize=60&amp;autostart='+au+'&amp;repeat=no&amp;controlbar=bottom&amp;dock=false&amp;plugins=http://hn.nhac.vui.vn/upload/players/spectrumvisualizer-1.swf&amp;spectrumvisualizer.effect=reflection" src="http://hn.nhac.vui.vn/upload/nhacvui-player.swf"/>',
		//Soha.vn
		'<embed width="'+m_w+'" height="42" '+_mode+' flashvars="&amp;autostart='+au+'" src="http://musik.soha.vn/share/k14/track/'+x+'" />',
		//*.mp3
		'<object '+_mode+' data="http://dl.dropbox.com/u/52283085/player/rdo/dewplayer.swf?mp3='+x+'&c1=20b1df&c2=ff0000&down=1&autoplay='+au+'" width="'+m_w+'" height="20"/><param name="movie" value="http://dl.dropbox.com/u/52283085/player/rdo/dewplayer.swf?mp3='+x+'&c1=20b1df&c2=ff0000&down=1&autoplay=1" /></object>'
	];
	}